package com.gylang.print.pdf.test.docx;

import org.docx4j.Docx4J;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;

import java.io.File;
import java.io.FileOutputStream;

/**
 * @author gylang
 * data 2021/6/2
 */
public class Docx2Ddf {

	public static void main(String[] args) throws Exception {
		WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
			.load(new File(SampleDoc.BASE + "pdf_template.docx"));
		// 格式很奇怪
		Docx4J.toPDF(wordMLPackage, new FileOutputStream(SampleDoc.BASE + "pdf_template.pdf"));

	}
}
